home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PRIVATE.ZIP / _CKBIOSK.C < prev    next >
Text File  |  1992-11-21  |  1KB  |  54 lines

  1. #define        CURSES_LIBRARY  1
  2. #define NEEDS_OS2       1
  3. #include <curses.h>
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid__ckbiosk = "$Header: c:/curses/private/RCS/_ckbiosk.c%v 2.0 1992/11/15 03:24:29 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   PDC_check_bios_key() - Check BIOS key data area for input
  15.  
  16.   PDCurses Description:
  17.        This is a private PDCurses routine.
  18.  
  19.        This routine will check the BIOS for any indication that
  20.        keystrokes are pending.
  21.  
  22.   PDCurses Return Value:
  23.        Returns 1 if a keyboard character is available, 0 otherwise.
  24.  
  25.   PDCurses Errors:
  26.        No errors are defined for this function.
  27.  
  28.   Portability:
  29.        PDCurses        bool    PDC_check_bios_key( void );
  30.  
  31. **man-end**********************************************************************/
  32.  
  33. bool PDC_check_bios_key(void)
  34. {
  35. #ifdef FLEXOS
  36.        retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  37.        return( (retcode < 0L) ? ERR : vir.vc_tahead );
  38. #endif
  39. #if    defined (DOS)
  40.  return(kbhit());
  41. #endif
  42. #if    OS2
  43. #if !defined(MSC)
  44.        KBDKEYINFO keyInfo;
  45.        
  46. /*     KbdCharIn(&keyInfo, IO_NOWAIT, 0);*/    /* get a character      */
  47.        KbdPeek(&keyInfo, 0);   /* peek at keyboard     */
  48.        return (keyInfo.fbStatus != 0);
  49. #else
  50.  return(kbhit());
  51. #endif
  52. #endif
  53. }
  54.